#pragma once

#include "DXAMLCommon.h"
#include "XamlNamespace.h"
#include "XamlProperty.h"
#include "XamlText.h"
#include "XamlType.h"
#include "XamlQualifiedObject.h"
#include "XamlLineInfo.h"

//struct XamlQualifiedObject;

//class CXString;


class XamlNode
{
public: 
	enum XamlNodeType
	{
		xntNone = 0x0,
		xntStartObject = 0x1,
		xntEndObject = 0x2,
		xntStartProperty = 0x3,
		xntEndProperty = 0x4,
		xntText = 0x5,
		xntValue = 0x6,
		xntNamespace = 0x7,
		xntEndOfAttributes = 0x8,
		xntEndOfStream = 0x9,
		xntLineInfo = 0xA
	};


	XamlNode();
	void InitAddNamespaceNode(const xshared_ptr<CXString> & ssPrefix, const xshared_ptr<XamlNamespace> & xamlNamespace);
	void InitStartObjectNode(const xshared_ptr<XamlType> & inXamlType, XBOOL bIsRetrieved, XBOOL bIsUnknown);
	void InitEndObjectNode();
	void InitStartMemberNode(const xshared_ptr<XamlProperty> & inXamlProperty);
	void InitEndMemberNode();
	void InitEndOfAttributesNode();
	void InitEndOfStreamNode();
	void InitTextValueNode(const xshared_ptr<XamlText> & inXamlText);
	void InitValueNode(const xshared_ptr<XamlQualifiedObject> & inQO);
	const XamlLineInfo & get_LineInfo() const;
	void set_LineInfo(const XamlLineInfo & lineInfo);
	const enum XamlNode::XamlNodeType & get_NodeType() const;
	const xshared_ptr<CXString> & get_Prefix() const;
	const xshared_ptr<XamlNamespace> & get_Namespace() const;
	const xshared_ptr<XamlType> & get_XamlType() const;
	const xshared_ptr<XamlProperty> & get_Property() const;
	const xshared_ptr<XamlText> & get_Text() const;
	const xshared_ptr<XamlQualifiedObject> & get_Value() const;
	XBOOL get_IsRetrievedObject() const;
	XBOOL IsUnknown() const;
private: 
	xshared_ptr<IXamlSchemaObject> m_spShared;
	xshared_ptr<XamlQualifiedObject> m_spValue;
	enum XamlNode::XamlNodeType m_NodeType;
	struct  
	{
		XUINT32 m_bIsRetrieved:1;
		XUINT32 m_bIsUnknown:1;
	};

	XamlLineInfo m_LineInfo;
	xshared_ptr<CXString> m_ssPrefix;
};



